package com.maimao.core.enums;

/**
 * @author MaoLin Wang
 * @date 2020/11/30 4:24 下午
 */
public enum ExceptionEnum {


    FORBIDDEN(false, 403, "权限不足"),
    NOT_LOGIN(false, 401, "请登录"),
    INVALID_FILE_TYPE(false, 4000, "文件内容格式不正确"),
    UPLOAD_ERROR(false, 5000, "上传失败"),
    ILLEGAL_USER(false, 403, "非法用户"),
    ILLEGAL_ID_CARD_TYPE(false, 403, "非法上传类型"),
    NOT_APPLY_SHOP(false, 403, "尚未开通店铺或店铺尚未通过申请"),
    GOODS_CHECK_INVALID(false, 403, "审核状态非法"),
    UPDATE_INTEGRAL_ERROR(false, 500, "修改用户积分出错"),
    SAVE_INTEGRAL_AC_ERROR(false, 500, "保存积分日志出错"),
    SUBMIT_ERROR(false, 500, "下单失败"),
    SKU_NOT_EXIST(false, 500, "sku不存在或商品服务出错"),
    KILL_ORDER_NOT_EXIST(false, 500, "秒杀订单不存在"),
    STOCK_NOT_ENOUGH(false, 500, "库存不足"),
    INVALID_PARAMS(false, 500, "参数错误"),
    ES_NESTED_QUERY_ERROR(false, 500, "Es嵌套查询path为空"),
    ES_FIELD_IS_NULL(false, 500, "ES查询字段为空"),
    EXPORT_EXCEL_ERROR(false, 500, "导出excel失败"),
    BRAND_EXIST_ERROR(false, 500, "品牌已存在"),
    /**
     * 品牌绑定分类出错
     */
    BRAND_BIND_CATE_ERROR(false, 500, "绑定分类出错"),
    ;
    private Boolean flag;
    private Integer code;
    private String message;

    ExceptionEnum() {
    }

    ExceptionEnum(Boolean flag, Integer code, String message) {
        this.flag = flag;
        this.code = code;
        this.message = message;
    }

    public Boolean isFlag() {
        return flag;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
